curl --request POST \
--url https://api.topsort.com/toptimize/v1/rank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"ranking": [
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"category": {
"ids": [
"sneakers",
"shoes"
]
},
"products": {
"ids": [
"p_PJbnN",
"p_ojng4"
]
}
}
]
}'
{
"results": [
{
"products": [
{
"rank": 1,
"type": "organic",
"id": "p_Mfk11",
"resolvedItemId": "WyJiX01mazExIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTMyNjYtY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=="
},
{
"rank": 2,
"type": "sponsored",
"id": "p_Mfk15",
"resolvedItemId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
},
{
"rank": 3,
"type": "organic",
"id": "p_PJbnN",
"resolvedItemId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
}
],
"error": false
}
]
}
⚠️ Beta Access Required
Contact your sales representative to gain access to this endpoint and start using it.
Use the /ranking
endpoint to re-rank objects to show on a page. This endpoint can retrieve sponsored
and non-sonsored objects and rank them together, according to an appropriate context and behavior information.
curl --request POST \
--url https://api.topsort.com/toptimize/v1/rank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"ranking": [
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"category": {
"ids": [
"sneakers",
"shoes"
]
},
"products": {
"ids": [
"p_PJbnN",
"p_ojng4"
]
}
}
]
}'
{
"results": [
{
"products": [
{
"rank": 1,
"type": "organic",
"id": "p_Mfk11",
"resolvedItemId": "WyJiX01mazExIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTMyNjYtY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=="
},
{
"rank": 2,
"type": "sponsored",
"id": "p_Mfk15",
"resolvedItemId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
},
{
"rank": 3,
"type": "organic",
"id": "p_PJbnN",
"resolvedItemId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
}
],
"error": false
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
The context information to get the ranking, to rank organic and sponsored products.
The body is of type object
.
The ranking results. The list of winners will contain at most slots
entries per auction. It may contain fewer or no entries at all if there aren't enough products to fill the slots.
The response is of type object
.